package com.common.singleton;

/**
 * 双重校验锁
 *
 * Created by Administrator on 2018-9-13 0013.
 */
public class SingleTonWithSyncLock {

    private static SingleTonWithSyncLock instance = null;

    private SingleTonWithSyncLock() {
    }

    public static SingleTonWithSyncLock getInstance() {
        if(instance == null){
            synchronized (SingleTonWithSyncLock.class) {
                if(instance == null){
                    instance = new SingleTonWithSyncLock();
                }
            }
        }
        return instance;
    }
}
